<template>
  <el-card>
    <el-row style="text-align: center;">
      <el-button @click="goBack" type="info" size="small" round>返回</el-button>
    </el-row>
    <!--公司基本信息-->
    <org-company ref="orgCompanyRef" @refresh="refreshMain" :org-id="orgId" :parent-id="parentId"></org-company>
    <!--税务信息-->
    <org-tax style="margin-top: 15px" ref="orgTax" @refresh="refreshMain" :org-id="orgId"></org-tax>
    <!--银行账户信息-->
    <org-bank style="margin-top: 15px" :org-id="orgId"></org-bank>
    <!--部门信息-->
    <org-dept style="margin-top: 15px" ref="orgDept" :org-id="orgId" title-type="card"></org-dept>
  </el-card>
</template>

<script>
  import OrgCompany from "./OrgCompany";
  import OrgTax from "./OrgTax";
  import OrgBank from "./OrgBank";
  import OrgDept from "./OrgDept";

  export default {
    name: "OrgDetail",
    components: {OrgDept, OrgBank, OrgTax, OrgCompany},
    props: ['orgId','parentId'],
    data() {
      return {
      }
    },
    methods: {
      goBack() {
        this.$emit("returnValue", {status: 'org-list'});
      },
      refreshMain(value) {
        this.orgId = value.orgId
        //公司基本信息
        this.$refs.orgCompanyRef.orgId = value.orgId
        this.$refs.orgCompanyRef.parentId = value.parentId
        this.$refs.orgCompanyRef.load()
        //税务信息
        this.$refs.orgTax.orgId = value.orgId
        this.$refs.orgTax.load()
        //部门信息
        debugger
        this.$refs.orgDept.orgId = value.orgId
        this.$refs.orgDept.load()
      }
    }
  }
</script>

<style scoped>

</style>
